home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / getdrive.zip / GETDRIVE.ASM < prev    next >
Assembly Source File  |  1993-01-04  |  1KB  |  36 lines

  1. comment /
  2. pwd.asm--get the present working directory--returns directory path from
  3.          root without the leading backslash
  4. syntax:
  5. memvar=' '
  6. load getdrive
  7. call getdrive with memvar
  8.  
  9. returns: capital letter of current drive
  10.  
  11.                   ******** WARNING **********
  12. I have not tested this extensively.  No guarantees or responsibility  taken.
  13. Russell Freeland (Synergy Corp.) 305-792-1866  5-9-86
  14. Compuserve 76146,371
  15. /
  16. CODESEG SEGMENT BYTE PUBLIC 'CODE'
  17.       assume cs:codeseg,es:codeseg
  18.  
  19. GETDRIVE PROC FAR
  20.  
  21. START:
  22.         push    ds
  23.         push    es
  24.         mov     si,bx                   ;move the offset of our memvar into si
  25.         mov     ah,19h                  ;to set up DOS function call "current disk"
  26.         int     21h                     ;call DOS
  27.         mov     byte ptr [bx],al        ;move it into the memvar
  28.         add     byte ptr [bx],41H       ;convert to capital letter
  29.         pop     es                      ;pop the regs back
  30.         pop     ds
  31.         ret
  32. GETDRIVE  ENDP
  33. CODESEG ENDS
  34.         END  START
  35.  
  36.